<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/11/14
 * Time: 16:26
 */
namespace Pay\Controller;

use Api\Controller\BaseApiController;
use User\Model\UserModel;
use Pay\Model\PayModel;

class ApiController extends BaseApiController
{
    private $pay_db;
    private $mid;

    function _initialize()
    {
        parent::_initialize();
        $this->user_db = new UserModel();
        $this->pay_db = new PayModel();
    }

    /**
     * @param int $type
     */
    function getMsg($type=0){
        $result = $this->pay_db->where(array('type'=>I('type')))->find();
        if(empty($result)){
            $this->jsonOutput(showData(new \stdClass(),'请耐心等待，正在处理',1));
        }else{
            if(I('type'==3)){
                $result['headbig']='';
            }else{
                if(empty($result['headsmall'])){
                    $this->jsonOutput(showData(new \stdClass(),'请耐心等待，正在处理',1));
                }
                $result['headbig']=implode('',explode('s_',$result['headsmall']));
            }
            $this->jsonOutput(showData($result));
        }
    }
}